<?php
/**
 * Notes:
 * User: LiaoHong
 * Date: 2025/10/25
 * Time: 9:03
 **/


namespace App\Http\Controllers\Archives;


use App\Http\Controllers\Controller;
use App\Services\Archives\ArchivesAdminService;
use Illuminate\Http\Request;

class ArchivesAdminController extends Controller
{

    /** @var ArchivesAdminService */
    private ArchivesAdminService $archivesAdminService;

    public function __construct(ArchivesAdminService $service)
    {
        $this->archivesAdminService = $service;
    }

    /**
     * @Notes:获取项目列表
     * @author: Liao Hong
     * @Time: 2025/10/25   11:09
     * @Interface getProjectList
     */
    public function getProjectList()
    {
        return success($this->archivesAdminService->getProjectList());
    }
    /**
     * @Notes:获取档案目录结构树
     * @author: Liao Hong
     * @Time: 2025/10/25   9:04
     * @Interface getFolederList
     */
    public function getFolederList(Request $request)
    {
        $params = $request->input();
        return success($this->archivesAdminService->getFolederList($params));
    }
    /**
     * @Notes:获取案卷列表数据
     * @author: Liao Hong
     * @Time: 2025/10/25   9:08
     * @Interface getList
     */
    public function getArchivesAdminList(Request $request)
    {
        $params = $request->input();
        return success($this->archivesAdminService->getArchivesAdminList($params));
    }

    /**
     * @Notes:获取卷内列表数据
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @author: Liao Hong
     * @Time: 2025/10/25   11:02
     * @Interface getArchivesAdminList
     */
    public function getArchivesFileList(Request $request)
    {
        $params = $request->input();
        return success($this->archivesAdminService->getArchivesFileList($params));
    }

    /**
     * @Notes:添加借阅
     * @author: Liao Hong
     * @Time: 2025/10/27   10:15
     * @Interface pullBorrow
     */
    public function pullBorrow(Request $request)
    {
        $params = $request->input();
        return success($this->archivesAdminService->pullBorrow($params));
    }

    /**
     * @Notes:借阅记录
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @throws \Exception
     * @author: Liao Hong
     * @Time: 2025/10/28   13:59
     * @Interface borrowList
     */
    public function borrowList(Request $request)
    {
        $params = $request->input();
        return success($this->archivesAdminService->borrowList($params));
    }
}
